package com.bytz.modules.cms.order.controller;

import com.bytz.common.api.vo.Result;
import com.bytz.common.aspect.annotation.AutoLog;
import com.bytz.modules.bpm.client.controller.BizFlowControllerBase;
import com.bytz.modules.bpm.client.model.response.StartFlowResponse;
import com.bytz.modules.cms.common.constants.AdminAuthConstants;
import com.bytz.modules.cms.order.entity.Order;
import com.bytz.modules.cms.order.model.OrderAuditEntity;
import com.bytz.modules.cms.order.model.OrderSaveRo;
import com.bytz.modules.cms.order.service.IOrderFlowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: cms-backend
 * @description:
 * @author: KyleWang
 * @create: 2022-10-24 15:36
 **/
@RestController
@Api(tags = "订单流程")
@RequestMapping("/bizflow/work_flow/order_flow")
@PreAuthorize("hasAuthority('" + AdminAuthConstants.Order.EDIT + "')") //权限
public class OrderFlowController extends BizFlowControllerBase<Order, OrderSaveRo, OrderAuditEntity, IOrderFlowService> {
    @Override
    @AutoLog("提交流程")
    @ApiOperation(
            value = "提交流程",
            notes = "提交流程"
    )
    @PostMapping({"/submitProcess"})
    public Result<StartFlowResponse> submitProcess(OrderSaveRo entity) throws Exception {
        return Result.error("不支持该方法");
    }

}